unit fUserList;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxStyles,        
         
         
       
         
       
    cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
  cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
  cxGridBandedTableView, cxGridDBBandedTableView, cxClasses, cxControls,
  cxGridCustomView, cxGrid, Menus, cxLookAndFeelPainters, StdCtrls, cxButtons,
  uDAInterfaces, uDADataTable, uDAScriptingProvider, uDAMemDataTable,
  uDARemoteDataAdapter, cxLookAndFeels, dxSkinsCore, dxSkinCaramel,
  dxSkinOffice2010Silver, dxSkinSeven, dxSkinscxPCPainter;

type
  TfmUserList = class(TForm)
    grdBrowser: TcxGrid;
    tvBrowser: TcxGridDBBandedTableView;
    tvBrowserId: TcxGridDBBandedColumn;
    tvBrowserColumn1: TcxGridDBBandedColumn;
    tvBrowserColumn2: TcxGridDBBandedColumn;
    tvBrowserColumn3: TcxGridDBBandedColumn;
    tvBrowserColumn4: TcxGridDBBandedColumn;
    tvBrowserColumn5: TcxGridDBBandedColumn;
    tvBrowserColumn6: TcxGridDBBandedColumn;
    tvBrowserColumn7: TcxGridDBBandedColumn;
    tvBrowserColumn8: TcxGridDBBandedColumn;
    lvBrowser: TcxGridLevel;
    rdaBrowser: TDARemoteDataAdapter;
    tblBrowser: TDAMemDataTable;
    dsBrowser: TDADataSource;
    lblBrowser: TLabel;
    tvBrowserColumn9: TcxGridDBBandedColumn;
    tvBrowserColumn10: TcxGridDBBandedColumn;
    tvBrowserColumn11: TcxGridDBBandedColumn;
    tvBrowserColumn12: TcxGridDBBandedColumn;
    tvBrowserColumn13: TcxGridDBBandedColumn;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmUserList: TfmUserList;

implementation

{$R *.dfm}

procedure TfmUserList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

procedure TfmUserList.FormCreate(Sender: TObject);
var
  sql: string;
begin
  sql := 'SELECT bu_id, bu_name, bu_cname, bu_pwd, bu_depart, bu_parent,bu_tel, bu_short,'+
          'bu_mobile,bu_ling,bu_mail,bu_system,bu_jobtitle,bu_dateofhire,bu_computername,bu_ipaddress FROM b_user';

  tvBrowser.BeginUpdate;
  try
    rdaBrowser.GetDataCall.ParamByName('aSQLText').AsString := AnsiToUtf8(sql);
    tblBrowser.MaxRecords := -1;
    rdaBrowser.Fill([tblBrowser], true, true);
  finally
    tvBrowser.EndUpdate;
  end;
end;

end.
